home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Linux / SLAX 6.0.8 / slax-6.0.8.iso / slax / base / 006-devel.lzm / usr / include / kspell2 / dialog.h < prev    next >
Encoding:
C/C++ Source or Header  |  2007-01-15  |  2.5 KB  |  89 lines

  1. // -*- Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil; -*-
  2. /*
  3.  * dialog.h
  4.  *
  5.  * Copyright (C)  2003  Zack Rusin <zack@kde.org>
  6.  *
  7.  * This library is free software; you can redistribute it and/or
  8.  * modify it under the terms of the GNU Lesser General Public
  9.  * License as published by the Free Software Foundation; either
  10.  * version 2.1 of the License, or (at your option) any later version.
  11.  *
  12.  * This library is distributed in the hope that it will be useful,
  13.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  15.  * Lesser General Public License for more details.
  16.  *
  17.  * You should have received a copy of the GNU Lesser General Public
  18.  * License along with this library; if not, write to the Free Software
  19.  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
  20.  * 02110-1301  USA
  21.  */
  22. #ifndef KSPELL_DIALOG_H
  23. #define KSPELL_DIALOG_H
  24.  
  25. #include <kdialogbase.h>
  26.  
  27. namespace KSpell2
  28. {
  29.     class Filter;
  30.     class BackgroundChecker;
  31.     class KDE_EXPORT Dialog : public KDialogBase
  32.     {
  33.         Q_OBJECT
  34.     public:
  35.         Dialog( BackgroundChecker *checker,
  36.                 QWidget *parent, const char *name=0 );
  37.         ~Dialog();
  38.  
  39.         QString originalBuffer() const;
  40.         QString buffer() const;
  41.  
  42.         void show();
  43.         void activeAutoCorrect( bool _active );
  44.  
  45.     public slots:
  46.         void setBuffer( const QString& );
  47.         void setFilter( Filter* filter );
  48.  
  49.     signals:
  50.         void done( const QString& newBuffer );
  51.         void misspelling( const QString& word, int start );
  52.         void replace( const QString& oldWord, int start,
  53.                       const QString& newWord );
  54.  
  55.         void stop();
  56.         void cancel();
  57.         void autoCorrect( const QString & currentWord, const QString & replaceWord );
  58.     private slots:
  59.         void slotMisspelling(const QString& word, int start );
  60.         void slotDone();
  61.  
  62.         void slotFinished();
  63.         void slotCancel();
  64.  
  65.         void slotAddWord();
  66.         void slotReplaceWord();
  67.         void slotReplaceAll();
  68.         void slotSkip();
  69.         void slotSkipAll();
  70.         void slotSuggest();
  71.         void slotChangeLanguage( const QString& );
  72.         void slotSelectionChanged( QListViewItem * );
  73.         void slotAutocorrect();
  74.  
  75.     private:
  76.         void updateDialog( const QString& word );
  77.         void fillSuggestions( const QStringList& suggs );
  78.         void initConnections();
  79.         void initGui();
  80.         void continueChecking();
  81.  
  82.     private:
  83.         class Private;
  84.         Private *d;
  85.     };
  86. }
  87.  
  88. #endif
  89.